<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!doctype html>
<html lang="en">

	<head>
		<title>待审核任务</title>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<!-- VENDOR CSS -->
		<link rel="stylesheet" href="styles/css/jquery-ui.min.css" />
		<link rel="stylesheet" href="styles/css/bootstrap.min.css">
		<link rel="stylesheet" href="styles/css/font-awesome.min.css">
		<link rel="stylesheet" href="styles/css/style.css">
		<!-- MAIN CSS -->
		<link rel="stylesheet" href="styles/css/main.css">
		<!-- FOR DEMO PURPOSES ONLY. You should remove this in your project -->
		<link rel="stylesheet" href="styles/css/demo.css">
		<!-- GOOGLE FONTS -->
		<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet">
		<!-- ICONS -->
		<link rel="apple-touch-icon" sizes="76x76" href="styles/images/apple-icon.png">
		<link rel="icon" type="image/png" sizes="96x96" href="styles/images/favicon.png">

		<script src="scripts/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="scripts/common/jquery-ui.min.js"></script>
	</head>

	<body>
		<!-- WRAPPER -->
		<div id="wrapper">
			<!-- NAVBAR -->
			<%@ include file="common/navbar.html"%>
			<!-- END NAVBAR -->
			<!-- LEFT SIDEBAR -->
			<%@ include file="common/sidebar.html"%>
			<!-- END LEFT SIDEBAR -->
			<!-- MAIN -->
			<!--<div class="main">
		<!-- MAIN CONTENT -->
			<div class="main">
				<div class="main-content">
					<div class="container-fluid">

						<div id="project" class="panel panel-default">
							<div class="panel-body">
								<div>
									<h4>项目修改</h4>
								</div>
								<hr>
								<form action="updateProjectExec" method="post" role="form" class="form-horizontal">
									<div id="project_info">
										<div class="form-group">
											<label class="control-label col-md-2" style="text-align: left;">项目编号：</label>
											<div class="col-md-3">
												<input type="text" class="form-control" name="pid" placeholder="项目编号" disabled value="${projectPhases[0].id.pmProjectInfo.pid}" />
											</div>
											<label class="control-label col-md-offset-2 col-md-2" style="text-align: left;">项目名称：</label>
											<div class="col-md-3">
												<input type="text" class="form-control" name="pname" value="${projectPhases[0].id.pmProjectInfo.pname}" placeholder="项目名称" />
											</div>
										</div>
										<div class="form-group">
											<label class="control-label col-md-2 " style="text-align: left;">项目开始时间：</label>
											<div class="col-md-3 ">
												<input type="text" class="form-control pro_start_time" name="proPlanStartTime" value="<s:date name=" projectPhases[0].id.pmProjectInfo.proPlanStartTime " format="yyyy-MM-dd " />" placeholder="项目开始时间" />
											</div>
											<label class="control-label col-md-offset-2 col-md-2" style="text-align: left;">项目结束时间：</label>
											<div class="col-md-3 ">
												<input type="text" class="form-control pro_end_time" name="proPlanEndTime" value="<s:date name=" projectPhases[0].id.pmProjectInfo.proPlanEndTime " format="yyyy-MM-dd " />" placeholder="项目结束时间" />
											</div>
										</div>
										<textarea class="form-control" rows="4" name="proVoc" placeholder="客户需求">${projectPhases[0].id.pmProjectInfo.proVoc}</textarea>
									</div>
									<div class="divider">
										<button id="project_phase_btn" type="button" class="btn btn-sm btn-primary pull-right"><span class="glyphicon glyphicon-chevron-down"></span> 展开</button>
										<h4>项目阶段修改</h4>
										<hr/>
									</div>

									<div id="project_phase">
										<script>
											flag = 1;
										</script>
										<s:iterator value="projectPhases">
											<script>
												var phase = "${id.pmPhaseInfo.phaseId}";
												phase = phase.substr(0, 2);
												if(phase == "PB" && flag == 1) {
													$("#project_phase").append("<hr style='margin:30px 0px;'/>");
													flag = 2;
												}
												if(phase == "PC" && flag == 2) {
													$("#project_phase ").append("<hr style='margin:30px 0px;'/>");
													flag = 3;
												}
												if(phase == "PD" && flag == 3) {
													$("#project_phase").append("<hr style='margin:30px 0px;'/>");
													flag = 4;
												}
											</script>
											<div class="form-group">
												<label class="control-label col-md-2" style="text-align: left;"><s:property value="id.pmPhaseInfo.phaseName"/></label>
												<div class="col-md-2">
													<input type="text" class="form-control phase_start_time" name="" placeholder="开始时间" value="<s:date name=" phasePlanStartTime " format="yyyy-MM-dd " />" />
												</div>
												<div class="col-md-2">
													<input type="text" class="form-control phase_end_time" name="" value="<s:date name=" phasePlanEndTime " format="yyyy-MM-dd " />" placeholder="截止时间" />
												</div>
												<div class="col-md-3">
													<input type="text" class="form-control" name="remarks" value="${remark}" placeholder="说明">
												</div>
												<div class="col-md-2">
													<div class="input-group">
														<input type="text" class="form-control" name="phasePoints" value="${phasePoint}" placeholder="KPI分值">
														<span class="input-group-addon">%</span>
													</div>
												</div>
											</div>
										</s:iterator>
										<script>
											if(flag == 4) {
												flag = 1;
											}
											$("#project_phase .phase_start_time").prop("name", "phasePlanStartTimes");
											$("#project_phase .phase_end_time").prop("name", "phasePlanEndTimes");
										</script>
									</div>

									<div class="form-group">
										<div class="col-sm-offset-2 col-sm-3">
											<button type="submit" class="btn btn-default btn-block">提交</button>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
				<!-- END MAIN CONTENT -->
			</div>
			<!-- END MAIN -->
			<div class="clearfix"></div>

		</div>
		<!-- END WRAPPER -->
		<!-- Javascript -->
		<script src="scripts/common/bootstrap.min.js"></script>
		<script src="scripts/common/jquery.slimscroll.min.js"></script>
		<script src="scripts/common/klorofil-common.js"></script>
		<script src="scripts/project/new_project.js"></script>

		<script>
			$(".pro_start_time,.pro_end_time,.phase_start_time,.phase_end_time").datepicker({
				showAnim: "blind",
				dateFormat: "yy-mm-dd",
				changeYear: true,
				changeMonth: true,
				monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
				dayNamesMin: ['日', "一", "二", "三", "四", "五", "六"],
			});

			//处理project_phase区域隐藏显示功能
			$("#project_phase").hide();
			$("#project_phase_btn").click(function() {
				$("#project_phase").slideToggle(500, function() {
					var clazz1 = "glyphicon glyphicon-chevron-down";
					var clazz2 = "glyphicon glyphicon-chevron-up";
					var clazzNow = $("#project_phase_btn").children().eq(0).attr("class");
					if(clazzNow == clazz1) {
						$("#project_phase_btn").children().eq(0).attr("class", clazz2);
					} else {
						$("#project_phase_btn").children().eq(0).attr("class", clazz1);
					}
				});
			});
		</script>
	</body>

</html>